///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#ifndef __VEC3F_H__
#define __VEC3F_H__

#include <Config.h>
#include <Math/Matrix4x4.h>

//-----------------------------------------------------------------------------

class Vec3f
{
public:

	f32 x,y,z;

	Vec3f ( );
	Vec3f ( const f32& x, const f32& y, const f32& z );

	void set ( const f32& x, const f32& y, const f32& z );
	void setX ( const f32& x);
	void setY ( const f32& y );
	void setZ ( const f32& z );

	f32 getX ();
	f32 getY ();
	f32 getZ ();

	f32 length ();

	void normalize ( );

	void add ( const Vec3f& v );
	void scale ( const f32& s );
	Vec3f cross ( const Vec3f& v );
	f32 dot ( const Vec3f& v );
	void transform ( const Matrix4x4& trans );

	//set
	Vec3f& operator = (const Vec3f &v);
	Vec3f& operator = (const f32& val);

	//negate
	const Vec3f operator - () const;

	const Vec3f operator + (const Vec3f &v) const;
	Vec3f& operator += (const Vec3f &v);

	const Vec3f operator - (const Vec3f &v) const;
	Vec3f& operator -= (const Vec3f &v);

	//dot
	const f32 operator * (const Vec3f &v) const;
	f32 operator *= (const Vec3f &v);

	//cross
	const Vec3f operator ^ (const Vec3f &v) const;
	Vec3f& operator ^= (const Vec3f &v);

	//scale
	const Vec3f operator * (const f32& val) const;
	Vec3f& operator *= (const f32& val);
	const Vec3f operator / (const f32& val) const;
	Vec3f& operator /= (const f32& val);

	//transform
	const Vec3f operator * (const Matrix4x4& mat) const;
	Vec3f& operator *= (const Matrix4x4& mat);
};

#endif	//	__VEC3F_H__
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
